package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.YtBillMaterialSupplier;
import com.ruoyi.system.mapper.YtBillMaterialSupplierMapper;
import com.ruoyi.system.service.IYtBillMaterialSupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 材料商发票Service业务层处理
 * 
 * @author magichaohao
 * @date 2021-05-19
 */
@Service
public class YtBillMaterialSupplierServiceImpl implements IYtBillMaterialSupplierService 
{
    @Autowired
    private YtBillMaterialSupplierMapper ytBillMaterialSupplierMapper;

    /**
     * 查询材料商发票
     * 
     * @param materialSupplierInvoiceId 材料商发票ID
     * @return 材料商发票
     */
    @Override
    public YtBillMaterialSupplier selectYtBillMaterialSupplierById(Long materialSupplierInvoiceId)
    {
        return ytBillMaterialSupplierMapper.selectYtBillMaterialSupplierById(materialSupplierInvoiceId);
    }

    /**
     * 查询材料商发票列表
     * 
     * @param ytBillMaterialSupplier 材料商发票
     * @return 材料商发票
     */
    @Override
    public List<YtBillMaterialSupplier> selectYtBillMaterialSupplierList(YtBillMaterialSupplier ytBillMaterialSupplier)
    {
        return ytBillMaterialSupplierMapper.selectYtBillMaterialSupplierList(ytBillMaterialSupplier);
    }

    /**
     * 新增材料商发票
     * 
     * @param ytBillMaterialSupplier 材料商发票
     * @return 结果
     */
    @Override
    public int insertYtBillMaterialSupplier(YtBillMaterialSupplier ytBillMaterialSupplier)
    {
        return ytBillMaterialSupplierMapper.insertYtBillMaterialSupplier(ytBillMaterialSupplier);
    }

    /**
     * 修改材料商发票
     * 
     * @param ytBillMaterialSupplier 材料商发票
     * @return 结果
     */
    @Override
    public int updateYtBillMaterialSupplier(YtBillMaterialSupplier ytBillMaterialSupplier)
    {
        return ytBillMaterialSupplierMapper.updateYtBillMaterialSupplier(ytBillMaterialSupplier);
    }

    /**
     * 删除材料商发票对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYtBillMaterialSupplierByIds(String ids)
    {
        return ytBillMaterialSupplierMapper.deleteYtBillMaterialSupplierByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除材料商发票信息
     * 
     * @param materialSupplierInvoiceId 材料商发票ID
     * @return 结果
     */
    @Override
    public int deleteYtBillMaterialSupplierById(Long materialSupplierInvoiceId)
    {
        return ytBillMaterialSupplierMapper.deleteYtBillMaterialSupplierById(materialSupplierInvoiceId);
    }
}
